package org.car.world.service.impl;

import java.util.ArrayList;
import java.util.List;

import org.apache.commons.pool2.impl.AbandonedConfig;
import org.car.world.core.entily.TypeTable;
import org.car.world.core.mapper.TypeTableMapper;
import org.car.world.service.TypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.lang.NonNull;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.github.pagehelper.PageHelper;


@Service
@Transactional(rollbackFor = {RuntimeException.class, Exception.class})
public class TypeServiceImpl implements TypeService {


    @Autowired
    TypeTableMapper typeTableMapper;

    @Override
    public int deleteByPrimaryKey(Integer typeId) {
        return typeTableMapper.deleteByPrimaryKey(typeId);
    }

    @Override
    public int insert(TypeTable record) {
        return typeTableMapper.insert(record);
    }

    @Override
    public TypeTable selectByPrimaryKey(Integer typeId) {
        return typeTableMapper.selectByPrimaryKey(typeId);
    }

    @Override
    public List<TypeTable> selectAll() {
        return typeTableMapper.selectAll();
    }

    @Override
    public int updateByPrimaryKey(TypeTable record) {
        return typeTableMapper.updateByPrimaryKey(record);
    }

    @Override
    public List<TypeTable> selectlimit(Integer form, Integer size, String typeName) {
        //使用分页插件,核心代码就这一行
        PageHelper.startPage(form, size, true);
        List<TypeTable> list = typeTableMapper.selectTname(typeName);
        return list;
    }

    @Override
    public int selectconent() {
        return typeTableMapper.selectconent();
    }

    @Override
    public List<TypeTable> selectTname(String typeName) {
        return typeTableMapper.selectTname(typeName);
    }

    @Override
    public List<TypeTable> selectAllTypeName() {
        return typeTableMapper.selectAllTypeName();
    }

    @Override
    public List<TypeTable> selectAllidentify(String typeIdentify) {
        return typeTableMapper.selectAllidentify(typeIdentify);
    }

}
